import React, { useState } from 'react';
import { AndroidOutlined, AppleOutlined } from '@ant-design/icons';
import { Tabs } from 'antd';
import Salenum from './content_two/Salenum';
import Visuted from './content_two/Visuted';

export default function Content_two(props) {
  console.log(props.getlist);
  const a=props.getlist;
  const [tablist, settablist] = useState([
    {
      name: '销售额',
      icon: <AndroidOutlined />,
      context: <Salenum ></Salenum>,
    },
    {
      name: '访问量',
      icon: <AppleOutlined />,
      context: <Visuted></Visuted>,
    },
  ]);
  return (
    <div>
      <Tabs
        style={{ width: '100%', height: '100%' }}
        defaultActiveKey="2"
        items={tablist.map((Icon, i) => {
          const id = String(i + 1);
          return {
            key: id,
            label: Icon.name,
            children: Icon.context,
            icon: Icon.icon,
          };
        })}
      />
    </div>
  );
}
